#!/bin/bash
# 使用bash执行这个代码
# 激活环境

current_dir=$(cd "$(dirname "$0")";pwd) # 将当前目录赋值给变量current_dir
cd "$current_dir" # 切换到目录
echo "当前所在目录: $current_dir" # 打印当前目录
echo "开始激活python环境..."
source .crawler/bin/activate
echo "当前Python解释器: $(which python)"
echo "开始执行爬虫任务..."

# task 1
nohup python main.py >> logs/crawler_task.log 2>&1 &
